<template>
    <div class="g-weekend">
        <h2>周末去哪儿</h2>
        <ul>
            <li class="weekend-item border-bottom" v-for="item of list" :key="item.id" v-if="showWeekend">
                <div class="item-img-wrapper">
                    <img class="item-img" :src="item.imgUrl" alt="" />
                </div>
                <div class="item-info ">
                    <p class="item-title">{{item.title}}</p>
                    <p class="item-desc">{{item.desc}}</p>
                </div>
            </li>
        </ul>
    </div>
</template>

<script>
export default {
  name: 'HomeWeekend',
  props: {
    list: Array
  },
  computed: {
    showWeekend () {
      return this.list.length
    }
  }
}
</script>

<style lang="stylus" scoped>
    @import '~styles/mixins.styl'
    .g-weekend
        h2
            line-height .8rem
            background #eee
            text-indent .2rem
    .weekend-item
        // background #f7f7f7
        .item-img-wrapper
            height 0
            padding-bottom 37.09%
            .item-img
                width 100%
        .item-info
            padding .1rem
            .item-title
                ellipsis()
                font-size .36rem
                line-height .6rem
            .item-desc
                ellipsis()
                line-height .4rem
</style>
